From: Jim Meyering Date: Mon, 31 Jan 2011 07:34:45 +0000 (+0100) Subject: charset.c (load_charset_map): Don't deref NULL on failed malloc. X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1~1^2~324^2~4999 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=a8b85ea05cc73e7b1bc4387338f815b5b8e2a18e;p=emacs.git charset.c (load_charset_map): Don't deref NULL on failed malloc. --- diff --git a/src/ChangeLog b/src/ChangeLog index e66e9c8a77e..64675e653e7 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2011-01-31 Jim Meyering + + * charset.c (load_charset_map): Don't deref NULL on failed malloc. + Use xmalloc rather than malloc. + 2011-01-30 Paul Eggert strftime: import from gnulib diff --git a/src/charset.c b/src/charset.c index 57e24ae0c31..a6046600194 100644 --- a/src/charset.c +++ b/src/charset.c @@ -292,7 +292,7 @@ load_charset_map (struct charset *charset, struct charset_map_entries *entries, else { if (! temp_charset_work) - temp_charset_work = malloc (sizeof (*temp_charset_work)); + temp_charset_work = xmalloc (sizeof (*temp_charset_work)); if (control_flag == 1) { memset (temp_charset_work->table.decoder, -1,